const express = require('express');
const router = express.Router();

const exchangeService = require('../service/exchangeService')

// 表单验证
const expressJoi = require('@escook/express-joi')
const { exchange_insert,exchange_update } = require('../rule/exchangeRule')

router.get('', exchangeService.exchange);

router.get('/byId', exchangeService.exchangeById);

router.post('/add', expressJoi(exchange_insert), exchangeService.add);

router.post('/delete',exchangeService.delete);

router.post('/update',expressJoi(exchange_update) ,exchangeService.update);


module.exports = router;
